<template>
	<div :class="userData.resultPermiss == 2 ? '' : 'maskDisabled1'">
		<dialogTable v-if="isShow" type="portray" title="肉厚定点一覧" @close="isShow = false" @getResponse="getResponse">
		</dialogTable>
		<div class="tabs-cps-view" v-loading="loading" :class="userData.resultPermiss == 2 ? '' : 'maskDisabled2'">


			<div class="add-view" v-if="userData.resultPermiss == 2">
				<el-button size="small" @click="save"
					:style="{ background: Type == 1 ? '#bc000f' : '', color: Type == 1 ? 'white' : '', borderColor: Type == 1 ? '#bc000f' : '' }"
					:disabled="delFlg">
					{{ $t("message.bhView.topBtnDownList.addition") }}
				</el-button>
				<el-button size="small" @click="_del" :disabled="Type == 1 || noDataFlg"
					:style="{ background: delFlg ? '#bc000f' : '', color: delFlg ? 'white' : '', bordercoLOR: delFlg ? '#bc000f' : '' }">
					{{ $t("message.bhView.topBtnDownList.delete") }}
				</el-button>
			</div>

			<div :class="Type != 1 && noDataFlg ? 'maskDisabled1' : ''" class="container">
				<div :class="Type != 1 && noDataFlg ? 'maskDisabled2' : ''">

					<div class="row">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_1") }}
							</div>
							<!-- <el-input v-model="value" class="ipt yellow"></el-input> -->
							<el-date-picker v-model="contentData.preDate" class="ipt orange date-ipt" type="month"
								placeholder=" " :format="timeFormat" :value-format="timeFormat"></el-date-picker>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_2") }}
							</div>
							<div class="radio-view">
								<el-radio v-for="(item, index) in distinguish" :key="index"
									v-model="contentData.actukbn" :label="index == 0 ? 1 : 0"
									:disabled="contentData.oldActukbn != 1 && Type != 1 ? true : false">{{ item.label
									}}</el-radio>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_5") }}
							</div>
							<div class="flex-ipt-view">
								<el-input v-model="contentData.posNo" class="ipt orange mini-ipt"
									@input="contentData.posNo = $setMyNum(contentData.posNo, '3 - 0')"></el-input>
								<el-select v-model="contentData.posName" class="ipt orange small-ipt" placeholder=" "
									filterable allow-create
									@input="contentData.posName = $setMaxLength(contentData.posName, 200)">
									<el-option v-for="(item, index) in checkLocList" :key="index" :label="item"
										:value="item">
									</el-option>
								</el-select>
							</div>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_6") }}
							</div>
							<el-select v-model="contentData.ispSpcCode" class="ipt orange" placeholder=" " filterable
								allow-create
								@input="contentData.ispSpcCode = $setMaxLength(contentData.ispSpcCode, 12)">
								<el-option v-for="item in checkSurfaceList" :key="item" :label="item" :value="item">
								</el-option>
							</el-select>
						</div>
					</div>

					<div class="row">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_7") }}
							</div>
							<el-select v-model="contentData.tCodName" class="ipt" placeholder=" "
								@change="_changeRcodname">
								<el-option v-for="(item, index) in checkObjectiveList" :key="index" :label="item.label"
									:value="item.label">
								</el-option>
							</el-select>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_8") }}
							</div>
							<el-select v-model="contentData.opCodName" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in exiOpnList" :key="index" :label="item" :value="item">
								</el-option>
							</el-select>
						</div>
					</div>

					<div class="row">
						<div class="item">
							<div class="label">
								検査方案
							</div>
							<el-select v-model="contentData.ispWayName" class="ipt" placeholder=" " filterable
								allow-create
								@input="contentData.ispWayName = $setMaxLength(contentData.ispWayName, 20)">
								<el-option v-for="(item, index) in checkBillList" :key="index" :label="item"
									:value="item">
								</el-option>
							</el-select>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_10") }}
							</div>
							<el-select v-model="contentData.constructionPeriod" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in exeTimList" :key="index" :label="item" :value="item">
								</el-option>
							</el-select>
						</div>
					</div>

					<div class="row">
						<!-- 腐蚀系统 -->
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_11") }}
							</div>
							<el-select v-model="contentData.rCodName" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in corrSysList" :key="index" :label="item.label"
									:value="item.label">
								</el-option>
							</el-select>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_12") }}
							</div>
							<el-select v-model="contentData.oCodName" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in opeWrkList" :key="index" :label="item" :value="item">
								</el-option>
							</el-select>
						</div>
					</div>

					<div class="row" v-if="$store.state.macType == 2">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_13") }}
							</div>
							<el-select v-model="contentData.proNo" class="ipt orange" placeholder=" ">
								<el-option v-for="(item, index) in proLineNoList" :key="index" :label="item"
									:value="item">
								</el-option>
							</el-select>
						</div>
					</div>

					<div class="row border_bottom">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_14") }}
							</div>
							<el-input v-model="contentData.bfrComm" class="ipt long-ipt"
								@input="contentData.bfrComm = $setMaxLength(contentData.bfrComm, 60)"></el-input>
						</div>
					</div>

					<div class="row">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_15") }}
							</div>
							<!-- <el-input
					v-model="contentData.opeDate"
					class="ipt orange"
				></el-input> -->
							<el-date-picker v-model="contentData.opeDate" class="ipt"
								:class="contentData.actukbn == 0 ? 'orange' : ''" placeholder=" " :format="timeFormat1"
								:value-format="timeFormat1"></el-date-picker>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_16") }}
							</div>
							<el-input v-model="contentData.ispMemb" class="ipt"
								@input="contentData.ispMemb = $setMaxLength(contentData.ispMemb, 40)"></el-input>
						</div>
					</div>

					<div class="row">
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_17") }}
							</div>
							<el-select v-model="contentData.deterMine" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in ispRstList" :key="index" :label="item" :value="item">
								</el-option>
							</el-select>
						</div>
						<div class="item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_18") }}
							</div>
							<el-select v-model="contentData.dpCodName" class="ipt" placeholder=" ">
								<el-option v-for="(item, index) in dpsTypeList" :key="index" :label="item"
									:value="item">
								</el-option>
							</el-select>
						</div>
					</div>
					<!-- 检査方法 -->
					<div class="row border_bottom">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_19") }}
							</div>
							<div class="strat-view">
								<el-select v-model="contentData.woCodName" class="ipt small-ipt" placeholder=" ">
									<el-option v-for="(item, index) in ispWayList" :key="index" :label="item"
										:value="item">
									</el-option>
								</el-select>
								<el-select v-model="contentData.wtCodName" class="ipt small-ipt" placeholder=" ">
									<el-option v-for="(item, index) in ispWayList" :key="index" :label="item"
										:value="item">
									</el-option>
								</el-select>
								<el-select v-model="contentData.wfCodName" class="ipt small-ipt" placeholder=" ">
									<el-option v-for="(item, index) in ispWayList" :key="index" :label="item"
										:value="item">
									</el-option>
								</el-select>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_20") }}
							</div>
							<el-input type="textarea" :rows="4" placeholder=" " v-model="contentData.summary"
								class="textarea long-ipt"
								@input="contentData.summary = $setMaxLength(contentData.summary, 2000)"></el-input>
						</div>
					</div>

					<div class="row border_bottom">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_21") }}
							</div>
							<el-input type="textarea" :rows="4" placeholder=" " v-model="contentData.countermeasures"
								class="textarea long-ipt"
								@input="contentData.countermeasures = $setMaxLength(contentData.countermeasures, 600)"></el-input>
						</div>
					</div>

					<!-- 计划/实施==>{{ contentData.actukbn }}余寿命评价==>{{ contentData.residual }}计算方式==》{{ contentData.thckCalcType }} -->

					<div class="row">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_22") }}
							</div>
							<div class="radio-view-long long-ipt">
								<el-radio v-model="contentData.residual" label="3" :disabled="contentData.actukbn == 1">
									{{ $t("message.rightDetailMessage.tab1.label_25") }}
								</el-radio>
								<el-radio v-model="contentData.residual" label="1" :disabled="contentData.actukbn == 1">
									{{
										$t("message.rightDetailMessage.tab1.label_23")
									}}
								</el-radio>
								<el-radio v-model="contentData.residual" label="2" :disabled="contentData.actukbn == 1">
									{{
										$t("message.rightDetailMessage.tab1.label_24")
									}}
								</el-radio>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_26") }}
							</div>
							<div class="ipt-flex-view long-ipt">
								<div class="ipt-flex-message">
									<el-input v-model="contentData.remalife" class="small-ipt mini-ipt116"
										:class="(contentData.residual == 1 && contentData.thckCalcType == 1) ? 'yellow' : (contentData.residual == 1 && contentData.thckCalcType == 2) ? 'orange' : (contentData.residual == 2) ? 'orange' : ''"
										:disabled="contentData.residual == 3" :readonly="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ||
											(contentData.actukbn == 1 && (contentData.residual == 1 || contentData.residual == 2)
												&& (contentData.thckCalcType == 1 || contentData.thckCalcType == 2))"
										@input="contentData.remalife = $setMyNum(contentData.remalife, '3 - 2')">
									</el-input>

									<span class="mgl8">{{
										$t("message.rightDetailMessage.tab1.label_27")
									}}</span>
								</div>

								<div class="ipt-flex-message">
									<span class="mgr8 ipt-flex-message-label">{{
										$t("message.rightDetailMessage.tab1.label_30")
									}}</span>
									<!-- <el-input v-model="contentData.lifeReachesYear"
										class="small-ipt mini-ipt116 left"
										:disabled="contentData.residual == 3"></el-input> -->
									<el-date-picker v-model="contentData.lifeReachesYear" type="month" :format="format"
										:class="(contentData.residual == 2 || contentData.residual == 1) ? 'yellow' : ''"
										:value-format="format" placeholder=" " class="small-ipt  left"
										style="max-width: 120px;" :disabled="contentData.residual == 3" readonly>
									</el-date-picker>
								</div>

								<div class="ipt-flex-message">
									<span class="mgr8 ipt-flex-message-label">
										{{ $t("message.rightDetailMessage.tab1.label_39") }}
									</span>
									<el-input v-model="contentData.lstThck" class="small-ipt mini-ipt116"
										:class="(contentData.residual == 1 && contentData.thckCalcType == 1) ? 'yellow' : ''"
										:disabled="contentData.residual != 1" :readonly="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ||
											(contentData.actukbn == 1 && (contentData.residual == 1)
												&& (contentData.thckCalcType == 1 || contentData.thckCalcType == 2))"
										@input="contentData.lstThck = $setMyNum(contentData.lstThck, '3 - 2')">
									</el-input>
									<span class="mgl8">[mm/y]</span>
								</div>
							</div>
						</div>
					</div>
					<!-- **************** -->
					<div class="row">
						<div class="item long-item">
							<div class="label">
								計算方法
							</div>
							<div class="radio-view-long">
								<el-radio v-model="contentData.thckCalcType" :label="1"
									:disabled="contentData.residual != 1">
									自動計算
								</el-radio>
								<el-radio v-model="contentData.thckCalcType" :label="2"
									:disabled="contentData.residual != 1">
									手動計算
								</el-radio>
							</div>
						</div>
					</div>
					<!-- **************** -->
					<!-- <div class="row">
			<div class="item">
				<div class="label">
					{{ $t("message.rightDetailMessage.tab1.label_15") }}
				</div>
				<el-date-picker
					v-model="contentData.opeDate"
					type="date"
					class="ipt orange"
					placeholder=" "
					:format="timeFormat"
					:value-format="timeFormat"
				></el-date-picker>
			</div>
		</div> -->

					<div class="row">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_28") }}
							</div>
							<div class="ipt-flex-view long-ipt">
								<div class="ipt-flex-message">
									<el-date-picker v-model="contentData.constructionDate" type="month"
										class="small-ipt "
										:class="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ? 'orange' : ''"
										:format="timeFormat" :value-format="timeFormat"
										:disabled="contentData.residual != 1"></el-date-picker>
								</div>

								<div class="ipt-flex-message">
									<span class="mgr8 ipt-flex-message-label">
										{{ $t("message.bhView.table.column6") }}
									</span>
									<el-input v-model="contentData.orgThck" class="small-ipt mini-ipt116 "
										:class="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ? 'orange' : ''"
										:disabled="contentData.residual != 1"
										@input="contentData.orgThck = $setMyNum(contentData.orgThck, '4 - 2')"></el-input>
									<span class="mgl8">[mm]</span>
								</div>

								<div class="ipt-flex-message" style="width:200px;">
									<button class="btn-basic-two">
										<el-button type="primary" class="small-btn" style="width:90px !important;"
											@click="calcBtn"
											:disabled="contentData.residual != 1 || !(contentData.actukbn == 0 && contentData.thckCalcType == 1)">
											{{ $t("message.rightDetailMessage.tab1.label_36") }}
										</el-button>
										<el-button type="primary" class="small-btn" style="width:90px !important;"
											@click="clearData" :disabled="contentData.residual != 1">
											{{ $t("message.rightDetailMessage.tab1.label_37") }}
										</el-button>
									</button>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="item long-item">
							<div class="label">
								{{ $t("message.rightDetailMessage.tab1.label_34") }}
							</div>
							<div class="ipt-flex-view long-ipt">
								<div class="ipt-flex-message">
									<el-input v-model="contentData.mgtThck" class="small-ipt mini-ipt116 "
										:class="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ? 'orange' : ''"
										:disabled="contentData.residual != 1"
										@input="contentData.mgtThck = $setMyNum(contentData.mgtThck, '4 - 2')"></el-input>
									<span class="mgl8">[mm]</span>
								</div>

								<div class="ipt-flex-message">
									<span class="mgr8 ipt-flex-message-label">
										{{ $t("message.rightDetailMessage.tab1.label_35") }}
									</span>
									<el-input v-model="contentData.remThck" class="small-ipt mini-ipt116 "
										:class="(contentData.actukbn == 0 && contentData.residual == 1 && contentData.thckCalcType == 1) ? 'orange' : ''"
										:disabled="contentData.residual != 1" :readonly="(contentData.actukbn == 1 && (contentData.residual == 1)
											&& (contentData.thckCalcType == 1 || contentData.thckCalcType == 2))"
										@input="contentData.remThck = $setMyNum(contentData.remThck, '4 - 2')">
									</el-input>
									<span class="mgl8">[mm]</span>
								</div>

								<div class="ipt-flex-message">
									<el-button type="primary" class="btn-basic" style="width:200px !important;"
										:disabled="contentData.residual != 1" @click="isShow = true">
										{{ $t("message.rightDetailMessage.tab1.label_33") }}
									</el-button>
								</div>
							</div>
						</div>
					</div>

					<div class="row" style="border-top:1px solid rgb(217 217 217);padding:10px 0;">
						<div class="item long-item">
							<div class="label" style="width:auto;margin-right:30px;">
								<el-checkbox v-model="contentData.crrThckType"
									:disabled="contentData.residual != 1">近傍肉厚使用</el-checkbox>
								<!-- <span>建设年月</span> -->
							</div>
							<div class="ipt-flex-view long-ipt">
								<div class="ipt-flex-message" style="width:auto;">
									<span class="mgr8">
										{{ $t("message.rightDetailMessage.tab1.label_29") }}
									</span>
									<el-input v-model="contentData.heaThck" class="small-ipt mini-ipt116"
										:class="(contentData.crrThckType && contentData.residual == 1 && contentData.thckCalcType == 1) ? 'orange' : ''"
										:disabled="contentData.residual != 1 || !contentData.crrThckType" :readonly="(contentData.actukbn == 1 && (contentData.residual == 1)
											&& (contentData.thckCalcType == 1 || contentData.thckCalcType == 2))"
										@input="contentData.heaThck = $setMyNum(contentData.heaThck, '4 - 2')">
									</el-input>
									<span class="mgl8">[mm]</span>
								</div>

								<div class="ipt-flex-message">
									<span class="mgr8 ipt-flex-message-label">
										{{ $t("message.rightDetailMessage.tab1.label_32") }}
									</span>
									<el-input v-model="contentData.crrDept" class="small-ipt mini-ipt116 mgr8"
										:disabled="contentData.residual != 1" :readonly="(contentData.actukbn == 1 && (contentData.residual == 1)
											&& (contentData.thckCalcType == 1 || contentData.thckCalcType == 2))"
										@input="contentData.crrDept = $setMyNum(contentData.crrDept, '4 - 2')">
									</el-input>
									<span>[mm]</span>
								</div>
								<span></span>
							</div>
						</div>
					</div>
				</div>
			</div>


		</div>
	</div>
</template>

<script>
import { getResOfferDetialEjectData, getOfferDetialCombox, calcCorrosionRate, delResOfferDetilEjectDataVerifyMsg, delResOfferDetilEjectData } from "@/api/api";
import { getLocalStorage } from "@/utils/storage";
import eventBus from "@/eventBus/bus";
import _ from 'lodash-es';
import dialogTable from './dialogTable.vue'
export default {
	name: "Tab_1",
	props: ["tableSelectRow"],
	data() {
		return {
			isShow: false,
			format: "yyyy-MM",
			delFlg: false,
			noDataFlg: false,
			value: "",
			Type: 2,
			radio: "1",
			options: [],
			optionsValue: "",
			textarea: "",
			//     dateValue: "2016-06",
			loading: false,
			contentData: {
				preDate: '',
				actuNo: "1069",
				actukbn: 0,
				approval: "0",
				bfrComm: "",
				bookCheck: '',
				cmnt: '',
				constructionDate: "",
				constructionPeriod: "",
				countermeasures: "",
				crrDept: "",
				crrThckType: true,
				deterMine: "",
				dpCodName: "",
				heaThck: "",
				ispMemb: "",
				ispRstAbrv: "0xFFFF80",
				ispSpcCode: "",
				ispWayName: " ",
				lifeReachesYear: "",
				lmtThck: '',
				lstThck: "",
				mgtThck: "",
				nextCrrName: '',
				nextIspName: '',
				nextIspSpcCode: '',
				nextIspWayName: '',
				nextOpeTrm: "",
				nextOpnName: "",
				nextPosName: '',
				nextPosNo: '',
				nextProNo: '',
				nextReply: "",
				nextSsnDate: "",
				nextWrkCls: "",
				oCodName: "",
				opCodName: "",
				opeDate: "",
				opeTrm: "",
				opnName: "",
				orgThck: "",
				photo: "",
				photoName: '',
				pltCode: 9,
				posName: "",
				posNo: '',
				proNo: '',
				tCodName: "",
				rCodName: "",
				remThck: "",
				remalife: "",
				residual: "3",
				ssnEndbled: 1,
				summary: "",
				thckCalcType: "1",
				thckRlType: "",
				wfCodName: "",
				woCodName: "",
				wrkCls: "",
				wtCodName: "",
			},
			offerComboxData: {},

			// combox
			checkLocList: [], // 检査位置
			distinguish: [
				{ key: '1', label: "計画" },
				{ key: '0', label: "実施" }
			], // 实施分区
			checkSurfaceList: [], // 检査面
			checkObjectiveList: [], // 检査目的
			exiOpnList: [], // 开放是否
			checkBillList: [], // 检査法案
			exeTimList: [], // 实施时期
			opeWrkList: [], // 作业分区
			proLineNoList: [], // 配管管线号
			corrSysList: [], // 腐蚀系统
			ispRstList: [], // 判定
			dpsTypeList: [], // 处理有无
			ispWayList: [
				{
					key: 0,
					label: ''
				}
			], // 检査方法

			// timeFormat: base.IP.indexOf("eng") == -1 ?  "yyyy-MM" : "MM-yyyy"
			timeFormat: "yyyy-MM",
			timeFormat1: "yyyy-MM-dd",
			result: {
				dstLstThck: '',		//Remalife
				dstOddLif: '',		//LifeReachesYear
				dstOddYear: '',		//LstThck
			},
			calcData: {
				ActuKbn: '',							//实施区分 0=实施 1=未实施
				CalcMethod: '',							//计算方式 1=自动计算 2=手动计算---thckCalcType
				OpeDate: '',							//实施日
				OrgThck: '',							//元肉厚111
				MgtThck: '',							//管理值111
				ChgDate: '',							//建设年月---constructionDate
				HeaThck: '',							//近傍肉厚111
				CrrDept: '',							//腐蚀深111
				SrcRemThck: '',							//残肉厚----remThck
				CrrThcktype: '',						//近傍肉厚使用 1: Checkd, 0: Unchecked 111
				// DstRemThck 参肉厚   DstLsThck 服饰率   DstOddLif 寿命到达年   DstOddYear 与寿命
			},
			userData: getLocalStorage("userData"),
			startData: ''
		};
	},

	computed: {
		macCodeValue() {
			return this.$store.state.macCode;
		},
		macNamebValue() {
			return this.$store.state.macNameb;
		},
	},
	components: {
		dialogTable
	},
	watch: {
		macNamebValue: {
			deep: true,
			handler: function (newV, oldV) {
				this.Type = 2;
				this.delFlg = false;
			},
		},
		offerComboxData(nVal) {
			// this.initDatas();
		},

		tableSelectRow: {
			deep: true,
			immediate: true,
			handler: function (newV, oldV) {
				this.Type = 2;

				if (newV == 'listEmpty') {
					this.loading = false;

					this.contentData = {};
					this.startData = _.cloneDeep({});
					this.noDataFlg = true;
					this.$emit("DataChangeFn", false)
					return
				}
				if (newV != 'listEmpty' && oldV) {

					this.loading = true;
					this.$store.state.ISP_Info = {};
					this.getResOfferDetialEjectDataApi();
				} else {
					this.contentData = this.$store.state.ISP_Info;
				}

			},
		},

		macCodeValue: {
			deep: true,
			handler: function (newV, oldV) {
				// this.getResOfferDetialEjectDataApi();
				// this.save()

			},
		},

		contentData: {
			deep: true,
			handler: function (newV, oldV) {
				console.log(newV);
				if (newV.actukbn == 1) {
					console.log(11);
					this.$emit("isDisabledFlgOne", 1)
					this.contentData.residual = '3';
				} else if (newV.actukbn == 0) {
					this.$emit("isDisabledFlgOne", 0)
				}

				this.$store.state.ISP_Info = newV;
				if (newV.preDate == '' || !newV.preDate) {
					this.$emit("changeBTN", true)
				} else {
					this.$emit("changeBTN", false)
				}

				// if (_.isEqual(newV, this.startData) || newV.preDate == '' || !newV.preDate) {
				// 	this.$store.state.isStop.flg = false;
				// } else {
				// 	this.$store.state.isStop.flg = true;
				// }
				console.log('目视详细数据对比', newV, this.startData, !_.isEqual(newV, this.startData));

				this.$emit("DataChangeFn", !_.isEqual(newV, this.startData))
			}
		}
	},
	methods: {
		// 肉厚式样参照
		getResponse(row) {
			console.log(row);
			this.contentData.orgThck = row.orgThck;
			this.contentData.mgtThck = row.mgtThck;
			this.contentData.constructionDate = row.chgDate;
		},
		clearData() {
			this.contentData.remalife = '';
			this.contentData.lifeReachesYear = '';
			this.contentData.lstThck = '';
			this.contentData.constructionDate = '';
			this.contentData.orgThck = '';
			this.contentData.mgtThck = '';
			this.contentData.remThck = '';
			this.contentData.heaThck = '';
			this.contentData.crrDept = '';
		},
		async _del() {
			this.delFlg = true;
			let msg = await this.getDelMsg();

			this.$confirm(msg, '', {
				confirmButtonText: 'OK',
				cancelButtonText: 'Cancel',
				type: 'warning'
			}).then(() => {
				this.delApi();
				this.delFlg = false;
			}).catch(() => {
				this.delFlg = false;
			});

		},
		async delApi() {
			let dataJson = {
				dmgCode: this.$store.state.macCode,
				actuNo: Number(this.$store.state.ISP_Info.actuNo),
			}
			let res = await delResOfferDetilEjectData(dataJson);
			if (res.data.code != 0) {
				this.$message({
					type: 'error',
					message: res.data.msg
				});
				return
			}
			this.$message({
				type: 'success',
				message: 'OK'
			});
			eventBus.$emit("LoadMSDetailTabelData")
		},
		//获取削除信息
		async getDelMsg() {
			let dataJson = {
				dmgCode: this.$store.state.macCode,
				actuNo: Number(this.$store.state.ISP_Info.actuNo),
			}
			let res = await delResOfferDetilEjectDataVerifyMsg(dataJson);
			if (res.data.code != 0) {
				return '削除？'
			}
			return res.data.data;
		},
		fatherFn() {
			this.Type = 1;
			this.getOfferDetialComboxApi();
			this.$nextTick(() => {
				this.contentData = {
					preDate: '',
					actuNo: "1069",
					actukbn: 0,
					approval: "0",
					bfrComm: "",
					bookCheck: '',
					cmnt: '',
					constructionDate: "",
					constructionPeriod: "",
					countermeasures: "",
					crrDept: "",
					crrThckType: false,
					deterMine: "",
					dpCodName: "",
					heaThck: "",
					ispMemb: "",
					ispRstAbrv: "0xFFFF80",
					ispSpcCode: "",
					ispWayName: " ",
					lifeReachesYear: "",
					lmtThck: '',
					lstThck: "",
					mgtThck: "",
					nextCrrName: '',
					nextIspName: '',
					nextIspSpcCode: '',
					nextIspWayName: '',
					nextOpeTrm: "",
					nextOpnName: "",
					nextPosName: '',
					nextPosNo: '',
					nextProNo: '',
					nextReply: "",
					nextSsnDate: "",
					nextWrkCls: "",
					oCodName: "",
					opCodName: "",
					opeDate: "",
					opeTrm: "",
					opnName: "",
					orgThck: "",
					photo: "",
					photoName: '',
					pltCode: 9,
					posName: "",
					posNo: '',
					proNo: '',
					tCodName: "",
					rCodName: "",
					remThck: "",
					remalife: "",
					residual: "3",
					ssnEndbled: 1,
					summary: "",
					thckCalcType: 1,
					thckRlType: "",
					wfCodName: "",
					woCodName: "",
					wrkCls: "",
					wtCodName: "",
				};
			})

			this.$emit("changeType", 1);
		},
		save() {
			//初始监听状态

			eventBus.$emit('getBasicStyleCompontensCurrent_EventBus');	//	基本仕样

			let Fn = () => {
				let qq = "ssqcop";
				this.Type = 1;
				this.getOfferDetialComboxApi();
				this.$nextTick(() => {
					this.contentData = {
						preDate: '',
						actuNo: "1069",
						actukbn: 0,
						approval: "0",
						bfrComm: "",
						bookCheck: '',
						cmnt: '',
						constructionDate: "",
						constructionPeriod: "",
						countermeasures: "",
						crrDept: "",
						crrThckType: false,
						deterMine: "",
						dpCodName: "",
						heaThck: "",
						ispMemb: "",
						ispRstAbrv: "0xFFFF80",
						ispSpcCode: "",
						ispWayName: " ",
						lifeReachesYear: "",
						lmtThck: '',
						lstThck: "",
						mgtThck: "",
						nextCrrName: '',
						nextIspName: '',
						nextIspSpcCode: '',
						nextIspWayName: '',
						nextOpeTrm: "",
						nextOpnName: "",
						nextPosName: '',
						nextPosNo: '',
						nextProNo: '',
						nextReply: "",
						nextSsnDate: "",
						nextWrkCls: "",
						oCodName: "",
						opCodName: "",
						opeDate: "",
						opeTrm: "",
						opnName: "",
						orgThck: "",
						photo: "",
						photoName: '',
						pltCode: 9,
						posName: "",
						posNo: '',
						proNo: '',
						tCodName: "",
						rCodName: "",
						remThck: "",
						remalife: "",
						residual: "3",
						ssnEndbled: 1,
						summary: "",
						thckCalcType: 1,
						thckRlType: "",
						wfCodName: "",
						woCodName: "",
						wrkCls: "",
						wtCodName: "",
					};
				})

				this.$emit("changeType", 1);
				this.startData = _.cloneDeep(this.contentData);
			}
			/**
			 * 2。  记录当前函数。
			 */
			if (this.$store.state.isCurrentNext) {
				Fn();
			} else {
				/**
				  * 4-1。   记录原来该运行的函数。
				  * 4-2。   执行保存弹出框操作。   
				  */
				this.$store.commit("changeIsCurrentFn", Fn);

				eventBus.$emit('EventBusBasicStyleCompontensSaveFn');	//	基本仕样
			}


		},
		_changeRcodname(e) {
			this.getOfferDetialComboxApi();
		},
		calcBtn() {
			this.result = {
				dstLstThck: '',
				dstOddLif: '',
				dstOddYear: '',
			};
			this.loading = true;
			let dataJson = {};
			dataJson.ActuKbn = Number(this.contentData.actukbn);
			dataJson.CalcMethod = Number(this.contentData.thckCalcType);
			dataJson.OpeDate = this.contentData.opeDate;
			dataJson.OrgThck = this.contentData.orgThck;
			dataJson.MgtThck = this.contentData.mgtThck;
			dataJson.ChgDate = this.contentData.constructionDate;
			dataJson.HeaThck = this.contentData.heaThck;
			dataJson.CrrDept = this.contentData.crrDept;
			dataJson.SrcRemThck = this.contentData.remThck;
			dataJson.CrrThcktype = this.contentData.crrThckType ? 1 : 0;
			dataJson.OpeDateLab = this.$t("message.rightDetailMessage.tab1.label_15"); //实施日LAB
			dataJson.ChgDateLab = this.$t("message.rightDetailMessage.tab1.label_28"); //建设年月LAB
			dataJson.OrgThckLab = this.$t("message.bhView.table.column6"); //原肉厚LAB
			dataJson.MgtThckLab = this.$t("message.rightDetailMessage.tab1.label_34"); //管理值LAB
			dataJson.HeaThckLab = this.$t("message.rightDetailMessage.tab1.label_29"); //金榜肉厚LAB
			dataJson.CrrDeptLab = this.$t("message.rightDetailMessage.tab1.label_32"); //腐蚀深LAB
			dataJson.SrcRemThckLab = this.$t("message.rightDetailMessage.tab1.label_35"); //参肉厚LAB

			// let dataJson = tools.deepClone(this.calcData);
			// dataJson.ActuKbn = Number(this.contentData.actukbn);
			// dataJson.CalcMethod = Number(dataJson.CalcMethod);
			// dataJson.OpeDate = this.contentData.opeDate;
			// dataJson.CrrThcktype = dataJson.CrrThcktype? 1 : 2 ;
			calcCorrosionRate(dataJson).then((res) => {
				this.loading = false;
				if (!res || res.data.code == 452) {
					return
				}
				if (res.data.code != 0) {
					this.$alert(res.data.msg, {
						confirmButtonText: 'OK',
						type: 'warning',
					});
					return
				}

				this.contentData.remalife = res.data.data.dstOddYear;
				this.contentData.lifeReachesYear = res.data.data.dstOddLif;
				this.contentData.lstThck = res.data.data.dstLstThck;
				this.contentData.remThck = res.data.data.dstRemThck;
			})
		},
		// result: {
		// 	dstLstThck: '',		//Remalife
		// 	dstOddLif: '',		//LifeReachesYear
		// 	dstOddYear: '',		//LstThck
		// },

		initDatas() {
			// this.offerComboxData
			this.checkLocList = this.offerComboxData.checkLocList;
			this.distinguish = this.offerComboxData.distinguish;
			this.checkSurfaceList = this.offerComboxData.checkSurfaceList;
			this.checkObjectiveList = this.offerComboxData.checkObjectiveList;
			this.exiOpnList = this.offerComboxData.exiOpnList;
			this.checkBillList = this.offerComboxData.checkBillList;
			this.exeTimList = this.offerComboxData.exeTimList;
			this.opeWrkList = this.offerComboxData.opeWrkList;
			this.proLineNoList = this.offerComboxData.proLineNoList;
			this.corrSysList = this.offerComboxData.corrSysList;
			this.ispRstList = this.offerComboxData.ispRstList;
			this.dpsTypeList = this.offerComboxData.dpsTypeList;
			this.ispWayList = this.offerComboxData.ispWayList || [];
			console.log(this.distinguish, "TTTTTTTTTTTTTTTT")
			// this.corrSysList = [{
			// 	label:'test11',
			// 	key:0
			// },{
			// 	label:'test22',
			// 	key:1
			// },{
			// 	label:'test33',
			// 	key:2
			// }]
		},

		isEmptyObject(obj) {
			for (var key in obj) {
				return false;
			}
			return true;
		},

		getResOfferDetialEjectDataApi() {
			this.Type = 2;
			if (!this.isEmptyObject(this.$store.state.ISP_Info)) {
				this.contentData = this.$store.state.ISP_Info;
				// 默认自动计算-使用近磅肉厚
				this.contentData.thckCalcType = "1";
				this.contentData.crrThckType = true;
				return
			}
			this.contentData = {};
			if (
				!this.tableSelectRow ||
				!this.$store.state.macCode ||
				!getLocalStorage("userName")
			)
				return;

			let temp = {
				userName: getLocalStorage("userName"),
				dmgCode: this.$store.state.macCode,
				actuNo: Number(this.tableSelectRow.actuNo) || 0,
			};

			getResOfferDetialEjectData(temp).then((res) => {
				if (res.data.code == -300) {
					// this.save();
					this.noDataFlg = true;
					this.contentData = {};
					this.loading = false;
					return
				}
				if (res.data.code == 0 && res.data.data.length > 0) {
					this.noDataFlg = false;

					this.contentData = res.data.data[0];
					this.contentData.oldActukbn = this.contentData.actukbn;
					// this.contentData.thckCalcType = "1";
					this.contentData.crrThckType = this.contentData.crrThckType == 1 ? true : false;

					// this.contentData.thckCalcType = `${this.contentData.thckCalcType}`

					this.contentData.residual = this.contentData.actukbn == '1' ? '3' : this.contentData.residual;

					let temp = this.contentData.residual;
					if (temp != "1" && temp != "2")
						this.contentData.residual = "3";

					// this.contentData.preDate = '2023-04-03'

					// let tempDate = this.contentData.preDate;
					// // 年-月
					// var r0 = tempDate.match(
					// 	/^([0-9]{4}|[0-9]{2})-([0]?[1-9]|[1][0-2])$/
					// );

					// // 月-年
					// var r1 = tempDate.match(
					// 	/^([0]?[1-9]|[1][0-2])-([0-9]{4}|[0-9]{2})$/
					// );

					// if (r0 && !r1)
					// 	this.timeFormat = "yyyy-MM";
					// else if (!r0 && r1)
					// 	this.timeFormat = "MM-yyyy";


					this.getOfferDetialComboxApi();
					this.startData = _.cloneDeep(this.contentData);
				} else {
					this.contentData = {};
					this.startData = _.cloneDeep({});
				}
				this.loading = false;
			});
		},

		getOfferDetialComboxApi() {
			// debugger
			if (
				!this.tableSelectRow ||
				!this.$store.state.macCode ||
				!getLocalStorage("userName")
			)
				return;

			console.log(
				"getOfferDetialComboxApi -=-=-=-=-= getOfferDetialComboxApi -=-=-=-=-=-",
			);
			let prnCode = 1;
			for (var i = 0; i < this.checkObjectiveList.length; i++) {
				if (this.checkObjectiveList[i].label == this.contentData.tCodName) {
					prnCode = this.checkObjectiveList[i].key;
				}
			}
			console.log(this.contentData.tCodName)
			let temp = {
				pltCode: this.$store.state.pltCode,
				userName: getLocalStorage("userName"),
				macCode: this.$store.state.realMacCode,
				dmgCode: this.$store.state.macCode,
				// prnCode: this.contentData.inspectCode,
				prnCode
			};
			getOfferDetialCombox(temp).then((res) => {
				this.offerComboxData = res.data.data;
				console.log(
					"getOfferDetialComboxApi -=-=-=-=-= ",
					this.offerComboxData
				);
				this.initDatas();
			});
		},

		dateChange(val) {
			//     console.log(`dateChange(${this.dateValue})`);
			//     this.getResOfferDetialEjectDataApi();
		},
	},
	created() { },
	mounted() {

		// this.$store.state.ISP_Info = {};
		this.getOfferDetialComboxApi();
		// this.getResOfferDetialEjectDataApi();
		eventBus.$on("changeType", (e) => {
			this.Type = e;
			// this.save();
		})
		eventBus.$on("isGetInfo1", () => {
			console.log('123123123');
			setTimeout(() => {
				this.$store.state.ISP_Info = {};
				this.getResOfferDetialEjectDataApi();
			}, 350);
		})
		this.contentData = this.$store.state.ISP_Info;
		this.Type = this.contentData.Type;

	},
	beforeDestroy() {
		this.contentData.Type = this.Type;
		this.contentData.noDataFlg = this.noDataFlg;
		this.$store.state.ISP_Info = this.contentData;
		console.log(this.$store.state.ISP_Info);
		eventBus.$off("changeType");
		eventBus.$off("isGetInfo1");
	},
	destroyed() { },
};
</script>

<style lang="scss" scoped>
.tabs-cps-view {
	width: 100%;

	.row {
		display: flex;
		justify-content: space-between;
		padding-bottom: 16px;

		.item {
			width: 48%;
			display: flex;
			justify-content: flex-start;

			.label {
				min-width: 83px;
				display: flex;
				align-items: center;
			}

			.strat-view {
				width: calc(100% - 83px);
				display: flex;
				align-items: center;
				justify-content: space-between;
			}
		}

		.long-item {
			width: 100%;

			.long-ipt {
				width: calc(100% - 89px);

				::v-deep .el-input__inner {
					width: 100%;
					height: 32px;
				}
			}
		}
	}

	.border_bottom {
		border-bottom: 1px solid #d9d9d9;
		margin-bottom: 12px
	}
}

.radio-view {
	width: 238px;
	height: 32px;
	border-radius: 4px;
	border: 1px solid #d9d9d9;
	display: flex;
	align-items: center;
	justify-content: center;
}

.radio-view-long {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	height: 32px;
	border-radius: 4px;
	border: 1px solid #d9d9d9;
	padding: 0 16px;

	.el-radio {
		width: 100px;
	}
}

.ipt-flex-view {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 32px;
}

.ipt-flex-message {
	display: flex;
	align-items: center;
	// .ipt-flex-message-label{
	//   display: block;
	//   width: 56px;
	// }
}

.ipt-flex-message:nth-child(1) {
	width: 140px;
}

.ipt {
	width: 238px;
	height: 32px;

	::v-deep .el-input__inner {
		width: 238px;
		height: 32px;
	}

	::v-deep .el-input__inner:focus {
		border: 1px solid #dcdfe6;
	}

	::v-deep .el-input__icon {
		line-height: 32px;
		color: #909399;
	}

	::v-deep .el-input__suffix {
		width: 32px;
		right: 0;
		background: #dee0e3;
	}
}

.small-ipt {
	width: 172px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		color: #606266 !important;
	}

	::v-deep .el-icon-date {
		display: flex;
		align-items: center;
		padding-left: 3px;
	}
}

.mini-ipt {
	width: 55px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		padding: 0;
		text-align: center;
	}
}

.small-ipt148 {
	width: 148px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		color: #606266 !important;
	}
}

.mini-ipt116 {
	width: 100px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		text-align: right;
	}
}

.mini-ipt74 {
	width: 74px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		text-align: right;
	}
}

.flex-ipt-view {
	width: 238px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.picker {
	width: 130px;

	::v-deep .el-input__inner {
		width: 130px;
	}

	::v-deep .el-input__suffix {
		background: transparent;
	}
}

.orange {
	::v-deep .el-input__inner {
		background: #ffdeac;
	}
}

.yellow {
	::v-deep .el-input__inner {
		background: #ffffe1;
	}
}

.textarea {
	::v-deep .el-textarea__inner {
		resize: none;
	}
}

.mgl8 {
	margin-left: 8px;
}

.mgr8 {
	margin-right: 8px;
}

.btn-basic {
	width: 272px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	// color: #fff;
	// background: #106ebe;
	border-radius: 4px;
}

.btn-basic-two {
	width: 272px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.small-btn {
	width: 128px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	// color: #fff;
	// background: #106ebe;
	border-radius: 4px;
}

.date-ipt {
	::v-deep .el-input__suffix {
		background: transparent;
	}
}

.add-view {
	width: 100%;
	padding-bottom: 12px;
	border-bottom: 1px solid #d9d9d9;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: 12px;

	button {
		width: 68px;
		height: 32px;
		// background: #ffffff;
		// border: 1px solid #d9d9d9;
		margin-left: 12px;
		border-radius: 4px;
	}
}

.left {
	::v-deep .el-input__inner {
		text-align: left;
	}
}
</style>
